<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'TestTree.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
     

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>


<style type="text/css">
ul {
	list-style-type: none;
}

.test_box {
	width: 400px;
	min-height: 120px;
	max-height: 300px;
	_height: 120px;
	padding: 3px;
	outline: 0;
	border: 0px solid #a0b3d6;
	font-size: 20px;
	word-wrap: break-word;
	overflow-x: hidden;
	overflow-y: auto;
}
</style>
</head>
<script type="text/javascript">
   // var  k=0;
    function zhan1(can){
        var tt="second"+can;
        var mm="uu"+can;
        var gg="tupian"+can;
        var ss=document.getElementById(tt);
        var uu=document.getElementById(mm);
        var tu=document.getElementById(gg);
        var li;
        if(ss.style.display=="none"&&ss.getAttribute("isclick")=="false"){
        	$.post(
   				"dier.action",
   				{id:can},  
          		function(data){
					var len=data.jsonob.length;
					ss.style.display="block";
					tu.src="img/nolines_minus.gif";
					for(var i=0;i<len;i++){
						li= document.createElement("li");
						var lian="lianjie?"+"id="+data.jsonob[i].seriesId;
						li.innerHTML="<a href='lian'>"+data.jsonob[i].seriesName+"</a>";
					 	uu.appendChild(li);
					}
					ss.setAttribute("isclick","true");
	   		 	 },
   	    		"json");  
   	    }
   		else if(ss.style.display=="none"&&ss.getAttribute("isclick")=="true"){
   			ss.style.display="block";
   		}
   		else{
			tu.src="img/nolines_plus.gif";
			ss.style.display="none";
		     //$("#"+mm).empty();//兼容ie和火狐用这个;
		}
	}
 </script>

<body>


	<div id="first" class="ul test_box">
		<ul>
			<c:forEach items="${list}" var="fli">
				<li><a href="javascript:void(0);" id="${fli.brandsId}"
					onclick="zhan1(${fli.brandsId})"> <img
						id="tupian${fli.brandsId}" src="img/nolines_plus.gif"></a>${fli.brandsName}
					<div id="second${fli.brandsId}" style="display:none" isclick="false">
						<ul id="uu${fli.brandsId}">
						</ul>
					</div>
				</li>
			</c:forEach>
		</ul>
	</div>


</body>
</html>
